package com.test.proxy.cglib;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;
//方法拦截器
public class MyMethodInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("========前置增强处理======");
        Object result = methodProxy.invokeSuper(o,objects);
        System.out.println("==========后置增强处理======");
        return result;
    }
}